home *** CD-ROM | disk | FTP | other *** search
- #define _H_CArrangeList
-
- typedef short (*ShortFunc)();
- typedef long *LongPtr;
-
- #include "CBureaucrat.h"
- #include "CPanorama.h"
- #include "CScrollPane.h"
-
- struct CArrangeList:CBureaucrat
- {
- CPanorama *itsPanorama;
- CScrollPane *itsScrollPane;
- short hIndent;
- short vIndent;
- short rows;
- short rowWidth;
- short rowHeight;
- short currentSelection;
- Boolean dirty;
- long clickTime;
- short clickRow;
-
- LongHandle itsOrder;
- LongHandle itemOffsets;
- Handle itsItems;
-
- ShortFunc compareProc;
- VoidFunc doubleProc;
-
- void IArrangeList(CView *theEnclosure,CBureaucrat *theSupervisor,
- short theWidth,short theHeight,short theHEncl,
- short theVEncl,Boolean hasHoriz,Boolean hasVert,
- Boolean hasSizeBox,short theRows,short theRowWidth,
- short theRowHeight,ShortFunc theCompareProc,
- VoidFunc theDoubleProc);
- void Dispose(void);
-
- void GetIndents(short *theHIndent,short *theVIndent);
- void GetRowCount(short *rowCount);
- void GetRowDimensions(short *theWidth,short *theHeight);
- void GetSelection(short *theSelection);
- Boolean IsDirty(void);
- void SetIndents(short theHIndent,short theVIndent,
- Boolean redraw);
- void SetRowDimensions(short theWidth,short theHeight,
- Boolean redraw);
- void SetSelection(short theSelection);
- void SetDirty(Boolean isDirty);
- void SetCompareProc(ShortFunc theFunc);
- void SetDoubleProc(VoidFunc theFunc);
-
- void AddRow(short count,short rowNum,Boolean redraw);
- void DeleteRow(short count,short rowNum,Boolean redraw);
-
- void SetRow(Ptr dataPtr,long dataLen,short rowNum,
- Boolean redraw);
- void DrawRow(register short rowNum);
- void InvertRow(register short rowNum);
-
- Boolean ValidRow(register short rowNum);
- void Draw(void);
-
- void DoClick(Point hitPt,short modifierKeys,long when);
- Ptr GetRowOffset(register short rowNum);
- long GetRowSize(register short rowNum);
-
- void Sort(short left,short right);
- Boolean Search(register Ptr dataPtr,register short dataLen,
- short *theRow);
- };
-
- struct CListPanorama:CPanorama
- {
- void Draw(Rect *area);
- void DoClick(Point hitPt,short modifierKeys,long when);
- };
-
- struct CArrangeTask:CMouseTask
- {
- CArrangeList *itsList;
- short lastItem;
- Boolean arranging;
-
- void IArrangeTask(CArrangeList *theList);
- void BeginTracking(Point *startPt);
- void KeepTracking(Point *currPt,Point *prevPt,Point *startPt);
- void EndTracking(Point *currPt,Point *prevPt,Point *startPt);
- };